import api from './index'

// 登录获取token
export const login = (data) => {
  return api.post('token', data)
}

// 验证token
export const verifyToken = (token) => {
  return api.post('token/verify', { token })
}

// 退出登录
export const logout = () => {
  return api.post('token/logout')
}

// 发送短信验证码
export const sendSmsCode = (phone) => {
  return api.post('sms/send', { phone })
}

// 验证短信验证码
export const verifySmsCode = (phone, code) => {
  return api.post('sms/verify', null, {
    params: { phone, code }
  })
}

// 注册
export const register = (data) => {
  return api.post('user/register', data)
} 